<?
	if(!empty($main_cat_id))
	{
		$current_page_main_cat=$main_cat_id;
	}else{
		$current_page_main_cat="";
	}
?>



<script language="javascript">
	
	function toggleMenu(id)
	{
		
		if(document.getElementById('divSubmenu'+id).style.display=="none")
		{
			$('#divSubmenu'+id).show(1000);	
		}else{
			$('#divSubmenu'+id).hide(1000);	
		}
		
	}
</script>
<img src="images/title_category.png" />
<table width="229" height="500" class="table_dark_grey">
	<td valign="top" height="100%">
		<table height="100%" cellpadding="5">
			
					
					<?
						$get_main=mysql_query("select * from os_category where is_publish=1 order by name_eng asc");
						
						while($m=mysql_fetch_array($get_main,MYSQL_ASSOC))
						{
					?>
                    <tr>
						<td valign="top">
                    <font class="side_cat_main"> <a href="javascript:toggleMenu(<?= $m['id'] ?>)"> :: <?= $m['name_eng'] ?></a></font><br />
                    <?
							$get_sub=mysql_query("select * from os_sub_category where main_category='".$m['id']."' and is_publish=1");
						
							if($m['id']==$current_page_main_cat)
							{
								$display="block";
							}
							else
							{
								$display="none";
							}
					?>	
					<div id="divSubmenu<?= $m['id'] ?>" style="display:<?= $display ?>;padding-left:10px">
					<?
							if(mysql_num_rows($get_sub))
							{
								while($s=mysql_fetch_array($get_sub))
								{
					?>
						<font class="side_cat_sub"> <a href="os_view_product.php?id=<?= $s['id'] ?>">- <?= $s['name_eng'] ?></a></font><br />
					<?			
								}
							}
						
					?>
					</div>
                            </td>
                    </tr>
                    
					<? } ?>
				
			
			
			<tr>
				<Td height="100%" ></Td>
			</tr>
		 </table>
 </td>
 </table>